" words.txt

" search whole words only
autocmd BufEnter french.txt nnoremap / /\<\><left><left>

" markdown header
autocmd BufEnter french.txt nnoremap <space>h1 yypVr=kA <!-- {{{1 --><esc>O\pagebreak<cr><esc>j
autocmd BufEnter french.txt nnoremap <space>h2 yypVr-kA <!-- {{{2 --><esc>
autocmd BufLeave french.txt unmap! <space>h1
autocmd BufLeave french.txt unmap! <space>h2

" Auto clear whitespace
autocmd BufWritePre french.txt ClearWhitespace

" Auto sort sentences
autocmd BufWritePre french.txt normal mpGV?^=*$j:sort u`p

" French {{{1
" upper case map {{{2
autocmd BufEnter french.txt noremap! Z3a Â
autocmd BufEnter french.txt noremap! Z4a À
autocmd BufEnter french.txt noremap! Zza Æ

autocmd BufEnter french.txt noremap! Z2e É
autocmd BufEnter french.txt noremap! Z3e Ê
autocmd BufEnter french.txt noremap! Z4e È
autocmd BufEnter french.txt noremap! Zze Ë

autocmd BufEnter french.txt noremap! Z3i Î
autocmd BufEnter french.txt noremap! Zzi Ï

autocmd BufEnter french.txt noremap! Z3o Ô
autocmd BufEnter french.txt noremap! Zzo Œ

autocmd BufEnter french.txt noremap! Z3u Û
autocmd BufEnter french.txt noremap! Z4u Ù
autocmd BufEnter french.txt noremap! Zzu Ü

autocmd BufEnter french.txt noremap! Zzc Ç

" TODO BufLeave french.txt buggy
" upper case unmap {{{2
autocmd BufLeave french.txt unmap! Z3a
autocmd BufLeave french.txt unmap! Z4a
autocmd BufLeave french.txt unmap! Zza

autocmd BufLeave french.txt unmap! Z2e
autocmd BufLeave french.txt unmap! Z3e
autocmd BufLeave french.txt unmap! Z4e
autocmd BufLeave french.txt unmap! Zze

autocmd BufLeave french.txt unmap! Z3i
autocmd BufLeave french.txt unmap! Zzi

autocmd BufLeave french.txt unmap! Z3o
autocmd BufLeave french.txt unmap! Zzo

autocmd BufLeave french.txt unmap! Z3u
autocmd BufLeave french.txt unmap! Z4u
autocmd BufLeave french.txt unmap! Zzu

autocmd BufLeave french.txt unmap! Zzc

" lower case map {{{2
autocmd BufEnter french.txt noremap! z3a â
autocmd BufEnter french.txt noremap! z4a à
autocmd BufEnter french.txt noremap! zza æ

autocmd BufEnter french.txt noremap! z2e é
autocmd BufEnter french.txt noremap! z3e ê
autocmd BufEnter french.txt noremap! z4e è
autocmd BufEnter french.txt noremap! zze ë

autocmd BufEnter french.txt noremap! z3i î
autocmd BufEnter french.txt noremap! zzi ï

autocmd BufEnter french.txt noremap! z3o ô
autocmd BufEnter french.txt noremap! zzo œ

autocmd BufEnter french.txt noremap! z3u û
autocmd BufEnter french.txt noremap! z4u ù
autocmd BufEnter french.txt noremap! zzu ü

autocmd BufEnter french.txt noremap! zzc ç

" lower case unmap {{{2
autocmd BufLeave french.txt unmap! z3a
autocmd BufLeave french.txt unmap! z4a
autocmd BufLeave french.txt unmap! zza

autocmd BufLeave french.txt unmap! z2e
autocmd BufLeave french.txt unmap! z3e
autocmd BufLeave french.txt unmap! z4e
autocmd BufLeave french.txt unmap! zze

autocmd BufLeave french.txt unmap! z3i
autocmd BufLeave french.txt unmap! zzi

autocmd BufLeave french.txt unmap! z3o
autocmd BufLeave french.txt unmap! zzo

autocmd BufLeave french.txt unmap! z3u
autocmd BufLeave french.txt unmap! z4u
autocmd BufLeave french.txt unmap! zzu

autocmd BufLeave french.txt unmap! zzc
